<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>我的门店</title>
    <script src="../js/mui.min.js"></script>
	<link href="../css/mui.min.css" rel="stylesheet" />
	<link rel="stylesheet" href="../css/style.css" />
	<link rel="stylesheet" href="../css/iconfont.css" />
	<link rel="stylesheet" href="../css/wallet.css" />
	<style type="text/css">
		.mdsk_timebox .mdsk_lispri{width: 100%; text-align: center; float: none;}
		.mui-bar-tab .mui-tab-item{background: #FF7831; color: white; font-size: 1.1rem;}
	</style>
    <script type="text/javascript" charset="utf-8">
      	mui.init();
    </script>
</head>
<body>
	<header class="mui-bar mui-bar-nav">
	    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
	    <h1 class="mui-title" id="chain_name"></h1>
	</header>
	<nav class="mui-bar mui-bar-tab" id="btn_line">
		<a class="mui-tab-item" href="jiaoban_index.html">
			<span class="mui-tab-label">交班</span>
		</a>
	</nav>
	<div class="mui-content">
		<div class="mendsk_box">
			<div class="mendsk_item">
				<div class="mdsk_timebox clearfix">
					<div class="mdsk_lispri">营业收入：<em id="sr">0</em></div>
				</div>
				<ul class="mdsk_list">
			
				</ul>
			</div>
		</div>
				  
	</div>
	<script src="../js/mui.min.js"></script>
<script type="text/javascript" src="../js/jquery.min.js"></script>
<script type="text/javascript" src="../js/layer/layer.min.js"></script>
<script type="text/javascript" src="../js/app.js"></script>

	<script type=text/javascript>
		$(function(){
			$.ajax({
			url: APP.api_url + 'agent/chain_data',
			data: {
				token: get_token(),
				uid: getUid(),
				chain_id:getValueByName("chain_id"),
				mobile:getValueByName("mobile")
			},
			success:function(data){
				//$("#chain_name").text(data.chain.name);
				if(data.code==200){
					var list=data.data;
					var html='';
					var sy=0;
					for(var i in list){
						var record=list[i];
						sy+=parseFloat(record['price']);
						var img=record['thumb'];
						if(record['is_atten']){
							img=record['wx_heading'];
						}
						if(!img){
							img="/images/member.jpg";
						}
						var des="收款";
						if(record['type']=='order'){
							des='线上订单';
						}else if(record['type']=='ads_order'){
							des='二维码收款';
						}
						html+='<li>'+
						'<a href="#" class="clearfix">'+
							'<div class="mdsk_memimg"><img src="'+img+'"></div>'+
							'<div class="mdsk_info">'+
								'<p class="mdsk_memnam">'+des+'</p>'+
								'<p class="mdsk_adress">'+record['mobile']+'</p>'+
								'<p class="mdsk_fktime">'+
									'<span>'+record['add_time']+'</span>'+
									'<span></span>'+
								'</p>'+
							'</div>'+
							'<div class="mdsk_dbpri">¥'+record['price']+'</div>'+
						'</a></li>';
					}
					$("#sr").text("￥"+sy);
				}else{
					html='<div class="mui-content">'+
							'<div class="no_style">'+
								'<p><span class="iconfont icon-wujilu"></span></p>'+
								'<p class="nr">很抱歉，暂无数据~</p>'+
							'</div>'+        
						'</div>';
					$("#sr").text("￥0");
					$("#btn_line").hide();
				}
				$(".mdsk_list").html(html);
			}
		});
		})
	function menuFix() {
	    var sfEls = document.getElementById("nav").getElementsByTagName("li");
	    for (var i=0; i<sfEls.length; i++) {
	        sfEls[i].onmouseover=function() {
	        this.className+=(this.className.length>0? " ": "") + "sfhover";
	        }
	        sfEls[i].onMouseDown=function() {
	        this.className+=(this.className.length>0? " ": "") + "sfhover";
	        }
	        sfEls[i].onMouseUp=function() {
	        this.className+=(this.className.length>0? " ": "") + "sfhover";
	        }
	        sfEls[i].onmouseout=function() {
	        this.className=this.className.replace(new RegExp("( ?|^)sfhover\\b"),
	
	"");
	        }
	    }
	}
	//window.onload=menuFix;
	
	</script>
</body>
</html>
